package jgl.vajra.kingkong.widget.bean;

import jgl.vajra.kingkong.BR;
import jgl.vajra.kingkong.R;

import java.util.ArrayList;
import java.util.List;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;


/**
 * Created by Administrator on 2017/4/11 0011.
 */

public class MultiPicChooseBean extends BaseObservable {


    @Bindable
    public String imgUrlString;

    @Bindable
    public int type; //0  添加图片的按钮   1  图片  2视频
    @Bindable
    public int addImageUrl;

    @Bindable
    public String title;

    @Bindable
    public boolean visiable;
    @Bindable
    public boolean isNotShowDelete;

    public void setType(int type) {
        this.type = type;
        notifyPropertyChanged(BR.type);
    }


    public void setTitle(String _title) {
        title = _title;
        notifyPropertyChanged(BR.title);
    }

    public void setVisiable(boolean _visiable) {
        visiable = _visiable;
        notifyPropertyChanged(BR.visiable);
    }

    public MultiPicChooseBean(int addImageUrl) {
        this.addImageUrl = addImageUrl;
        type = 0;
        isNotShowDelete = false;
        visiable = true;
    }

    public MultiPicChooseBean(String _imgUrl, int _type, String _title) {
        imgUrlString = _imgUrl;
        type = _type;
        title = _title;
        isNotShowDelete = true;
    }

    public MultiPicChooseBean() {
    }

    public static List<MultiPicChooseBean> getAddImageBean(int addImageSize, int selectImageType) {
        List<MultiPicChooseBean> multiPicChooseBeans = new ArrayList<>();
        int addImageRes =selectImageType==1?R.drawable.ic_add_image:R.drawable.ic_add_comment_image;
       /* if (addImageSize >= 2) {
            MultiPicChooseBean choosePojo = new MultiPicChooseBean(addImageRes);
            multiPicChooseBeans.add(choosePojo);
        } else if (addImageSize == 1) {
            MultiPicChooseBean choosePojo = new MultiPicChooseBean(addImageRes);
            MultiPicChooseBean choosePojo1 = new MultiPicChooseBean(addImageRes);
            multiPicChooseBeans.add(choosePojo);
            multiPicChooseBeans.add(choosePojo1);
        } else {
            MultiPicChooseBean choosePojo = new MultiPicChooseBean(addImageRes);
            MultiPicChooseBean choosePojo1 = new MultiPicChooseBean(addImageRes);
            multiPicChooseBeans.add(choosePojo);
            multiPicChooseBeans.add(choosePojo1);
            MultiPicChooseBean choosePojo2 = new MultiPicChooseBean(addImageRes);
            multiPicChooseBeans.add(choosePojo2);
        }*/
        MultiPicChooseBean choosePojo = new MultiPicChooseBean(addImageRes);
        multiPicChooseBeans.add(choosePojo);
        return multiPicChooseBeans;
    }


    @Override
    public String toString() {
        return "MultiPicChooseBean{" +
                "imgUrlString='" + imgUrlString + '\'' +
                ", type=" + type +
                ", addImageUrl=" + addImageUrl +
                ", visiable=" + visiable +
                '}';
    }
}
